package com.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;

@Entity
@NamedQueries(
		{
			@NamedQuery(name = "MembershipPayment.findMembershipPaymentByStatus", query = "select m from MembershipPayment m where m.active = :active"),
			@NamedQuery(name = "MembershipPayment.search", query = "select m from MembershipPayment m where m.active = true and m.member.name like :member and m.membership.name like :membership and m.paymentDate between :paymentFrom and :paymentTo")
		}
	)
public class MembershipPayment implements Serializable{
	private static final long serialVersionUID = 1L;
	public static final String FIND_MEMBERSHIPPAYMENT_BY_STATUS = "MembershipPayment.findMembershipPaymentByStatus";	
	public static final String SEARCH = "MembershipPayment.search";	
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int id;
	@OneToOne
	private Member member;
	@OneToOne
	private Membership membership;
	private BigDecimal fee;
	private int tenderMedia;
	@Column(length=500)
	private String remark;
	
	private Date paymentDate;
	private String paymentNo;
	
	@ManyToOne
	private User receivedBy;
	
	private boolean active;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public Member getMember() {
		return member;
	}
	public void setMember(Member member) {
		this.member = member;
	}
	public Membership getMembership() {
		return membership;
	}
	public void setMembership(Membership membership) {
		this.membership = membership;
	}
	public BigDecimal getFee() {
		return fee;
	}
	public void setFee(BigDecimal fee) {
		this.fee = fee;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getPaymentDate() {
		return paymentDate;
	}
	public void setPaymentDate(Date paymentDate) {
		this.paymentDate = paymentDate;
	}
	public boolean isActive() {
		return active;
	}
	public void setActive(boolean active) {
		this.active = active;
	}
	public int getTenderMedia() {
		return tenderMedia;
	}
	public void setTenderMedia(int tenderMedia) {
		this.tenderMedia = tenderMedia;
	}
	public String getPaymentNo() {
		return paymentNo;
	}
	public void setPaymentNo(String paymentNo) {
		this.paymentNo = paymentNo;
	}
	public User getReceivedBy() {
		return receivedBy;
	}
	public void setReceivedBy(User receivedBy) {
		this.receivedBy = receivedBy;
	}
	

	


}
